#! /bin/bash

/usr/bin/hive -S -e "
insert overwrite table dwb.width_sign
select fcr.id,
       fcr.appeal_status,
       fcr.origin_type,
       fcr.origin_channel,
       fcr.payment_state,
       fcr.payment_time,
       dc.itcast_school_id,
       dc.itcast_school_name,
       dc.itcast_subject_id,
       dc.itcast_subject_name,
       dd.department_name,
       fcr.create_date_time,
       fcr.dt
from dwd.fact_customer_relationship fcr
         left join dwd.dim_clazz dc
                   on fcr.itcast_clazz_id = dc.clazz_id
         left join dwd.dim_department dd
                   on fcr.creator = dd.employee_id;
"